package tx.transaction;

import cn.stimd.spring.context.annotation.Bean;
import cn.stimd.spring.context.annotation.Configuration;
import cn.stimd.spring.context.annotation.Import;
import cn.stimd.spring.jdbc.datasource.DataSourceTransactionManager;
import tx.jdbc.DataSourceConfig;

import javax.sql.DataSource;

/**
 * Created by Stimd
 * 项目地址：https://gitee.com/stimd/spring-wheel
 * 公众号：Java编程探微
 */
@Configuration
@Import(DataSourceConfig.class)
public class TransactionConfig {

    @Bean
    public DataSourceTransactionManager transactionManager(DataSource dataSource){
        return new DataSourceTransactionManager(dataSource);
    }
}
